local jvli = fk.CreateSkill{
  name = "jvli",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
    ["jvli"] = "巨力",
    [":jvli"] = "锁定技，你的【杀】的基础伤害值等于你距离其为1的角色数。若其他角色与你的距离大于1，其不能响应你使用的牌。",
    ["$jvli"] = "你赢不了的！",
}

jvli:addEffect(fk.DamageCaused, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(jvli.name) and
      data.card and data.card.trueName == "slash"
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local count = 0
    for _, p in ipairs(room:getOtherPlayers(player, false)) do
      if p:distanceTo(player) == 1 then
        count = count + 1 --#region 距离为1的角色数,下次再改，先跑起来了，先跑起来了，先跑起来了，先跑起来了，先跑起来了，先跑起来了,下次再改，先跑起来了，先跑起来了，先跑起来了，先跑起来了，先跑起来了,下次再改，先跑起来了，先跑起来了
      end
    end
    data:changeDamage(count - data.damage)
  end,
})

jvli:addEffect(fk.CardUsing, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(jvli.name) and
      table.find(player.room:getOtherPlayers(player, false), function(p)
        return p:distanceTo(player) > 1
      end)
  end,
  on_use = function(self, event, target, player, data)
    data.disresponsiveList = data.disresponsiveList or {}
    for _, p in ipairs(player.room:getOtherPlayers(player, false)) do
      if p:distanceTo(player) > 1 then
        table.insertIfNeed(data.disresponsiveList, p)
      end
    end
  end,
})

return jvli